package com.czk.bootlettuce.reentrantredislock;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author chenzhangkun
 * @ClassName RedisLockClient
 * @description: TODO
 * @date 2024年02月01日
 */
@Component
public class RedisLockClient {

    @Autowired
    private StringRedisTemplate redisTemplate;

    public Lock getReentrantLock(String resourceName) {
        return new ReentrantDistributedLock(resourceName, redisTemplate);
    }
}
